package leetcode;

/**
 * @author zhangjunfei
 * @date 2023/7/19 15:35
 */
public class L_1437 {
    public boolean kLengthApart(int[] nums, int k) {
        int i = 0, j =-1;

        for (;i < nums.length; i++) {
            if (nums[i] == 1) {
                if (j != -1 && i - j - 1 < k) {
                    return false;
                }
                j = i;
            }
        }
        return true;
    }
}
